<div id="wrapper">
    <div id="page-wrapper">
        <div class="panel panel-primary">
            <div class="panel-heading"><h5 class="panel-title"></h5></div>
            <div class="panel-body">
                <div id="toolbar" class="ms-toolbar">
                    <button id="toolbar-add" class="btn btn-danger" data-toggle="modal">
                        <span class="glyphicon glyphicon-plus"></span> 增加
                    </button>
                </div>
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog">
                        <div id="addbrand" class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                        aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel">增加品牌</h4>
                            </div>
                            <div class="modal-body">
                                <form id="brandform" class="form-horizontal" role="form" enctype="multipart/form-data">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">品牌名称</label>

                                        <div class="col-sm-10">
                                            <input id='brand_name' name="brand_name" type="text" class="form-control"
                                                   placeholder="请勿使用特殊字符">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">是否展示</label>

                                        <div class="col-sm-10">
                                            <select id='is_show' name="is_show" class="form-control">
                                                <option value="1">展示</option>
                                                <option value="0">不展示</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">展示顺序</label>

                                        <div class="col-sm-10">
                                            <input id='display_order' name="display_order" type="text"
                                                   class="form-control"
                                                   placeholder="请使用正整数">
                                        </div>
                                    </div>
                                    <div class="form-group text-center">
                                        <label class="col-sm-2 control-label">品牌logo</label>

                                        <div class="col-sm-10 ">
                                            <input id="logo" name="file" type="file" multiple class="file-loading">
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button id="close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                                </button>
                                <button id="confirm" type="button" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </div>
                    -->
                    <!-- /.modal-dialog -->
                </div>
                <div>
                    <table id="brandtable" class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>brand_id</th>
                            <th>brand_name</th>
                            <th>is_show</th>
                            <th>display_order</th>
                            <th>create_time</th>
                            <th>update_time</th>
                            <th>logo</th>
                            <th>删除</th>
                            <th>编辑</th>
                        </tr>
                        </thead>
                        <tbody>
                        {%notempty name="$data"%}
                        {%volist name="$data" id="vo"%}
                        <tr id={%$vo.brand_id%}>
                            <td>{%$vo.brand_id%}</td>
                            <td>{%$vo.brand_name%}</td>
                            <td>{%$vo.is_show%}</td>
                            <td>{%$vo.display_order%}</td>
                            <td>{%$vo.create_time |date="Y:m:d H:m:s",### %}</td>
                            <td>{%$vo.update_time |date="Y:m:d H:m:s",### %}</td>
                            <td class="chakan"><a href="{%$vo.logo%}" data-lightbox="{%$vo.brand_id%}">查看</a></td>
                            <td class="delbrand">
                                <button class="btn btn-danger btn-sm">删除</button>
                            </td>
                            <td class="editbrand">
                                <button class="btn btn-danger btn-sm">编辑</button>
                            </td>
                        </tr>
                        {%/volist%}

                        </tbody>
                    </table>
                    <div class="pull-right">
                        {%$data->render()%}
                    </div>
                    {%/notempty%}
                </div>


            </div>

        </div>
    </div>
</div>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div id="editbrand" class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">&times;</button>
                <h4 class="modal-title">编辑品牌</h4>
            </div>
            <div class="modal-body">
                <form id="edit_brandform" class="form-horizontal" role="form" enctype="multipart/form-data">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">品牌ID</label>

                        <div class="col-sm-10">
                            <input id='edit_brand_id' name="brand_name" type="text" class="form-control" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">品牌名称</label>

                        <div class="col-sm-10">
                            <input id='edit_brand_name' name="brand_name" type="text" class="form-control"
                                   placeholder="请勿使用特殊字符">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否展示</label>

                        <div class="col-sm-10">
                            <select id='edit_is_show' name="is_show" class="form-control">
                                <option value="1">展示</option>
                                <option value="0">不展示</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">展示顺序</label>

                        <div class="col-sm-10">
                            <input id='edit_display_order' name="display_order" type="text" class="form-control"
                                   placeholder="请使用正整数">
                        </div>
                    </div>
                    <div class="form-group text-center">
                        <label class="col-sm-2 control-label">品牌logo</label>

                        <div class="col-sm-10 ">
                            <input id="edit_logo" name="file" type="file" multiple class="file-loading">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="edit_close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                </button>
                <button id="edit_confirm" type="button" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id='deleteModal' tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">确认删除</h4>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
                <button id="delete_confirm" type="button" class="btn btn-danger">确认</button>
            </div>
        </div>
    </div>
</div>
<script src="/static/home/widget/shop/brand/brandlist.js"></script>
<script src="/static/home/widget/shop/brand/deletebrand.js"></script>
<script src="/static/home/widget/shop/brand/editbrand.js"></script>
